export function setItem(type: string, data: string | boolean | number | object): void {
  localStorage.setItem(type, JSON.stringify(data))
}
export function getItem(type: string): any {
  const data = localStorage.getItem(type)
  if (data) {
    return JSON.parse(data)
  }
  return ""
}
export function mockToken(): number {
  // 四小时
  return Date.now() + 1000 * 60 * 60 * 4
}
export function timeExpired(time: number): boolean {
  return Date.now() >= time
}
